﻿using Microsoft.AspNetCore.Mvc;
using SenFangKaoHe_MVC.Models.Entity;
using SenFangKaoHe_MVC.Services;
using SqlSugar;

namespace SenFangKaoHe_MVC.Controllers
{
    public class TiKuController : Controller
    {
        private readonly SqlSugarClient db;
        public TiKuController(SqlSugarClient db)
        {
            this.db = db;
        }

        public IActionResult Index()
        {
            return View();
        }

        public async Task<String> getTiKuMingCheng(string tkids)
        {
            return await new TiKuServices(db).getTiKuMingCheng(tkids);
        }

        public async Task<List<tiku>> getTiKus()
        {
            return await new TiKuServices(db).getTiKus();
        }

        public async Task<List<tikukaoti>> getKaoTi(int tkid)
        {

            return await new KaoShiServices(db).getKaoTi(tkid);
        }
    }
}
